<div id="content">
    <div id="page-heading"><h1>Quản lý danh mục</h1></div>
    <table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
        <tr>
            <th rowspan="3" class="sized"><img src="<?= base_url(); ?>images/admin_img/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
            <th class="topleft"></th>
            <td id="tbl-border-top">&nbsp;</td>
            <th class="topright"></th>
            <th rowspan="3" class="sized"><img src="<?= base_url(); ?>images/admin_img/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
        </tr>
        <tr>
            <td id="tbl-border-left"></td>
            <td>
                <!--  start content-table-inner -->
                <div id="content-table-inner">
                    <div class="table-content">
                        <div class="search">
                            <form namr="fr-search" id="fr-search" method="post" action="<?= base_url(); ?>dienhoa-administrator/san_pham/tat_ca_sp">
                                <ul class="ul-search">
                                    <li>Trạng thái: </li>
                                    <li>
                                        <select name="select" onChange="window.location='<?= base_url(); ?>dienhoa-administrator/dm_san_pham/tat_ca_dm/'+this.value;" class="opt2">
                                            <option value="">__ Tất cả __</option>
                                            <option value="1" <? if ($stt == 1) echo 'selected'; ?>>danh mục đang hoạt động</option>
                                            <option value="0" <? if ($stt == 0) echo 'selected'; ?>>danh mục đang tạm dừng</option>
                                        </select>
                                    </li>
                                    <li>Tên danh mục: </li>
                                    <li><input type="text" name="txtName" value=""/></li>
                                    <li><input type="submit" name="btnSend" value="Tìm"/></li>
                                </ul>
                            </form>
                            <div class="clear"></div>
                        </div>
                        <div class="tb_TCHoaDon">
                            <form name="formHD" id="formHD" action="<?= base_url(); ?>dienhoa-administrator/dm_san_pham/xoa" method="post">
                                <table class="table_infor">
                                    <thead>
                                        <tr>
                                            <th><input type="checkbox" name="items" id="items"/></th>
                                            <th>ID</th>
                                            <th>Tên</th>
                                            <th>menu</th>
                                            <th>Trạng thái</th>
                                            <th>Chi tiết</th>
                                        </tr>
                                    </thead>
                                    <tbody id="bd-hd">
                                        <? foreach ($dm_sp as $rows2): ?>
                                            <tr class="sp">
                                                <td><input type="checkbox" name="item[]" id="items" value="<?= $rows2->PID; ?>" <?foreach ($checkDM as $rows3): if($rows3->PID === $rows2->PID){ echo "disabled"; }  endforeach;?> /></td>
                                                <td class="Ma"><?= $rows2->PID; ?></td>
                                                <td class="Ngay"><?= $rows2->PName; ?></td>
                                                <? if($m_menu): ?>
                                                <? foreach ($m_menu as $rows4): ?>
                                                <? if($rows4->menu_id === $rows2->menu_id): ?>
                                                <td><?= $rows4->menu_name;?></td>
                                                <? endif; ?>
                                                <? endforeach; ?>
                                                <? endif; ?>
                                                <td><? if ($rows2->PStatus == 1) echo "Đang bán"; else echo "Tạm dừng"; ?></td>
                                                <td><a href="<?= base_url(); ?>dienhoa-administrator/dm_san_pham/chi_tiet_danh_muc/<?= $rows2->PID; ?>">Xem / Sửa</a></td>
                                            </tr>
                                        <? endforeach; ?>
                                    </tbody>
                                    <tfoot>
                                        <tr>
                                            <td><input type="submit" value="xóa" class="btnXoa"/></td>
                                            <td colspan="6" style="width: 50px;"><div class="phan_trang"><?= $pagination; ?></div></td>
                                        </tr>
                                    </tfoot>
                                </table>
                            </form>
                        </div>
                    </div>
                    <div class="clear"></div>
                </div>
                <!--  end content-table-inner  -->
            </td>
            <td id="tbl-border-right"></td>
        </tr>
        <tr>
            <th class="sized bottomleft"></th>
            <td id="tbl-border-bottom">&nbsp;</td>
            <th class="sized bottomright"></th>
        </tr>
    </table>

    <div class="clear">&nbsp;</div>

</div>
